package com.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TTree entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_tree", schema = "")
public class TTree implements java.io.Serializable {

	// Fields

	private String id;
	private TTree TTree;
	private String text;
	private String url;
	private Integer seq;
	private String iconCls;
	private Set<TTree> TTrees = new HashSet<TTree>(0);

	// Constructors

	/** default constructor */
	public TTree() {
	}

	/** minimal constructor */
	public TTree(String id, TTree TTree, String text, Integer seq) {
		this.id = id;
		this.TTree = TTree;
		this.text = text;
		this.seq = seq;
	}

	/** full constructor */
	public TTree(String id, TTree TTree, String text, String url, Integer seq, String iconCls, Set<TTree> TTrees) {
		this.id = id;
		this.TTree = TTree;
		this.text = text;
		this.url = url;
		this.seq = seq;
		this.iconCls = iconCls;
		this.TTrees = TTrees;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid", nullable = false)
	public TTree getTTree() {
		return this.TTree;
	}

	public void setTTree(TTree TTree) {
		this.TTree = TTree;
	}

	@Column(name = "text", nullable = false)
	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "url")
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "seq", nullable = false)
	public Integer getSeq() {
		return this.seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	@Column(name = "iconCls")
	public String getIconCls() {
		return this.iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TTree")
	public Set<TTree> getTTrees() {
		return this.TTrees;
	}

	public void setTTrees(Set<TTree> TTrees) {
		this.TTrees = TTrees;
	}

}